package OBJECT;

import java.util.Scanner;

public class Modth01 {

    public static void main(String[] args) {



//        输出方法
        PersonInfo p1 =new PersonInfo();

        p1.name="王林";
        p1.age=18;
        System.out.println("我是"+p1.name+"今年"+p1.age+"岁");
        p1.sysprenint();
        int sum =p1.sum();
        System.out.println("1...100之间相加的数是"+sum);

        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入一个数：");
        int num1 = scanner.nextInt();
        System.out.println("请输入第二个数：");
        int num2 = scanner.nextInt();
        System.out.println("两数之和是："+p1.getSteam(num1,num2));



        int[][] arr = new int[][]{{0,0,1},{1,1,1},{1,1,3}};
        System.out.println("打印数组");
        p1.printArray(arr);
    }

}


class  PersonInfo{

    String name;
    int age;

    public void  sysprenint(){
        System.out.println("我是个好人");
    }

//   添加 1...100之间相加的数
    public int sum(){
        int sum = 0;
        for (int i = 0; i < 100; i++) {
            sum+=i;
        }
        return sum;
    }

//    计算量输入之和
    public  int getSteam(int num1,int num2){
        return  num1+num2;
    }
//    输出一个数组
    public  void  printArray(int[][] arr){
        for (int i = 0; i < arr.length; i++) {
            for (int j = 0; j <arr[i].length ; j++) {
                System.out.println("arr[i][j]+++++++++...>>>>"+arr[i][j]);
            }
        }
    }

}
